package com.avantis.common.entity;

import com.avantis.common.entity.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName Supplier
 * @Description 供应商表
 * @Author kirago
 * @Date 2018/12/17 17:13
 * @Version 1.0
 **/
@Entity
@Data
@Table(name = "k_supplier")
public class Supplier extends BaseEntity implements Serializable {

    @ApiModelProperty("供应商编码")
    @Column
    private String supplierCode;

    @ApiModelProperty("供应商名称")
    @NotNull(message = "供应商名称必填项！")
    @Column
    private String supplierName;

	@ApiModelProperty("联系人姓名")
    @NotNull(message = "联系人姓名是必填项！")
    @Column
    private String contactName;

	//默认为0:男性
	@ApiModelProperty("性别")
    @NotNull(message = "性别是必填项！")
    @Column
    private Integer supplierSex = 0;


	@ApiModelProperty("联系人电话")
    @NotNull(message = "联系人电话不能为空！")
    @Column
    private String supplierPhone;

	//期初欠款默认为0
	@ApiModelProperty("期初欠款")
    @Column(scale = 2)
    private Double supplierDebt = 0.00;

	/**
	 * 供应商级别
	 * 0：普通供应商；1：一级；2：二级；3：三级
	 * 默认为普通供应商
	 */
    @ApiModelProperty("供应商等级")
    @NotNull(message = "供应商等级")
    @Column
    private Integer supplierLevel = 0;

    @ApiModelProperty("联系地址")
    @NotNull(message = "联系地址必填项！")
    @Column
    private String supplierAddress;

    /**
     * 供应商状态
     * 1：无效；0：有效
     * 默认为有效
     */
    @ApiModelProperty("供应商状态")
    @NotNull(message = "供应商状态必填项！")
    @Column
    private Integer supplierStatus = 0;

    @ApiModelProperty("业务员姓名")
    @Column
    private String relatedSalesmanId;

    @ApiModelProperty("供应商单位联系电话")
    @NotEmpty(message = "单位电话不能为空！")
    @Column
    private String supplierUnitPhone;

    @ApiModelProperty("传真")
    @Column
    private String supplierFax;

    @ApiModelProperty("单位所在地邮编")
    @Column
    private String supplierPostCode;

    @ApiModelProperty("联系人微信号")
    @Column
    private String supplierWechat;

    @ApiModelProperty("联系人邮箱")
    @NotNull(message = "联系人邮箱必填项！")
    @Column
    private String supplierEmail;

    @ApiModelProperty("备注")
    @Column
    private String supplierRemark;
}
